cc.Class({
    extends: cc.Component,

    properties: {
        contentLabel: {
            type: cc.Label,
            default: null,
        },
    },

    onLoad () {
        this.node.opacity = 0;
    },
    
    show (str) {
        this.contentLabel.string = str;
        this.node.runAction(cc.sequence(
            cc.fadeIn(0.2),
            cc.delayTime(0.8),
            cc.fadeOut(0.6),
            cc.callFunc(() => {
                this.node.removeFromParent();
            })
        ));
    },

    moveUp () {
        this.node.runAction(
            cc.moveBy(0.1, 0, this.node.height)
        );
    },
});
